import request from '@/utils/request'
export const fetchHomeData = (params = {}) => {
  params._page = params.pageNumber || 1 // 第几页
  params._limit = params.pageSize || 10 //每页多少条
  if (params.tag) {
    params.tag_like = params.tag
    delete params.tag
  }
  if (params.distanceOrder) {
    params._sort = 'distance'
    params._order = params.distanceOrder
    delete params.distanceOrder

  }
  delete params.pageNumber
  delete params.pageSize
  return request({
    method: 'GET',
    url: '/home',
    query: params
  })
}

export const recommendFoodList = () => {
  return request({
    method: 'GET',
    url: '/recommendFoodList'
  })
}